package org.springframework.beans;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Compenent;

import java.text.SimpleDateFormat;

/**
 * @Name Car
 * @Description: Bean 测试类
 * @Version v1.0.0
 * @Author: lichao
 * @Date: 2024-03-15 14:54:31
 **/
@Compenent
public class Car {
    private long date;
    @Value("${brand}")
    private String brand;

    public void init() {
        date = System.currentTimeMillis();
    }

    public void showTime() {
        System.out.println(date + ": bean created.");
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    @Override
    public String toString() {
        return "Car{" +
                "brand='" + brand + '\'' +
                '}';
    }
}

